<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
		<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
		<style type="text/css">
			.ui-page {
				background: white;
			}
			
			.ui-header {
				background-color: #5693C0 ! important;
				text-shadow: 0 1px 0 #3D586C ! important;
				padding-bottom: 5px;
			}
			
			.ui-content {
				padding: 0px 1em;
			}
			
			.ui-footer {
				color: #3D586C ! important;
				background: none ! important;
			}
			
			.ui-header, .ui-footer {
				border: none ! important;
			}
			
			.starRating {
				font-size: 26px;
			}
			
			.starRating .fa {
				cursor: pointer;
			}
			
			.starRating .fa-star {
				color: #3388CC;
			}
			
			.subbtn {
				opacity: 1 ! important;
				color: white;
			}
			
			.quTitleNum {
				/* position: absolute; */
				
			}
			
			.quTitleText {
				/* text-indent: 2em; */
				
			}
			
			#dwSurveyNote {
				padding-top: 0px;
			}
			
			.m_quOrderByUi {
				margin: 5px 0 5px 0;
				padding: 0;
				border: 1px solid #d5d5d5;
				border-radius: 3px;
			}
			
			.m_quOrderByUi li {
				border-color: #fff;
				font-size: 16px;
				min-height: 41px;
				position: relative;
				padding-right: 45px !important;
				border-bottom: 1px solid #EBEBEB !important;
			}
			
			.m_orderby_num {
				position: absolute;
				right: 10px;
				top: 55%;
				margin-top: -15px;
				min-width: 26px;
				height: 26px;
				background: #85C8FF;
				color: #fff;
				text-align: center;
				line-height: 26px;
				border-radius: 15px;
				z-index: 100;
				display: none;
			}
			
			.m_orderby_sel {
				position: absolute;
				top: 0px;
				left: 0px;
				width: 100%;
				height: 100%;
				opacity: 0;
				font-size: 30px;
				z-index: 9999;
				background-color: rgb(248, 248, 248);
				border: 1px solid rgb(166, 166, 166);
				border-image-source: initial;
				border-image-slice: initial;
				border-image-width: initial;
				border-image-outset: initial;
				border-image-repeat: initial;
				display: inline-block;
			}
			
			#wrap{
				overflow-x: hidden;
				margin: 0px 5px;
			}
			#dwSurveyName{
				width: auto;
			}
			#dwSurveyNoteEdit{
				width: auto;
				padding-right: 10px;
			}
			.surveyQuItem .surveyQuItemContent{
				width: calc(100% - 20px);
			}
			.surveyQuItem .surveyQuItemContent .quCoTitle .quCoTitleEdit{
				width: calc(100% - 45px);
			}
			table.quCoChenTable{
				width: auto;
			}
			table.quCoChenTable tr td{
				min-width: 80px;
			}
			@media screen and (max-width: 960px){
			  /* 手机端CSS代码 */
			  #dw_body_content{
			  	width: 100%;
			  }
			}
			 
			@media screen and (min-width: 960px){
			  /* 电脑端CSS代码 */
			  #dw_body_content{
			  	width: 60%;
			  }
			}
			.fraction{
				font-size: 13px;
				color: gray;
				white-space: nowrap;
			}
		</style>
	</head>

	<body style="background-color: RGB(232,233,235);">
		<div id="wrap">

		</div>
		<div class="footer-copyright footer-pb" style="color: gray;padding-bottom: 5px;">
			源码地址:
			<a href="https://gitee.com/doc_wei01/skyeye" style="text-decoration: none;color: gray;">skyeye</a>&nbsp;
		</div>
		
		<!-- 1单选题radio -->
		<script type="text/x-handlebars-template" id="radioTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
					{{#if hv}}
						{{#compare1 hv '3'}}
							<table class='tableQuColItem'>
								{{#each questionRadio}}
									<tr>
										{{#cellCount001 cellCount}}{{/cellCount001}}
									</tr>
								{{/each}}
								<tr>
							</table>
						{{else}}
						{{#if hv}}
						{{#compare1 hv '1'}}
							<ul class="transverse">
								{{#each questionRadio}}
									<li class="quCoItemUlLi">
										<div class="dwQuOptionItemContent">
											<label class="dwRedioStyle dwQuInputLabel" ></label>
											<input type="radio" name="qu_{{quType}}_{{quId}}" value="{{id}}" >
											<label class="quCoOptionEdit quCoOptionPadding">{{optionName}}</label>
											<input type='text' class='inputSytle_1' style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}" name="text_qu_{{quType}}_{{quId}}_{{id}}" />
										</div>
									</li>
								{{/each}}
							</ul>
						{{else}}
							<ul>
								{{#each questionRadio}}
									<li class="quCoItemUlLi">
										<div class="dwQuOptionItemContent">
											<label class="dwRedioStyle dwQuInputLabel" ></label>
											<input type="radio" name="qu_{{quType}}_{{quId}}" value="{{id}}" >
											<label class="quCoOptionEdit quCoOptionPadding">{{optionName}}</label>
											<input type='text' class='inputSytle_1' style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}" name="text_qu_{{quType}}_{{quId}}_{{id}}" />
										</div>
									</li>
								{{/each}}
							</ul>
						{{/compare1}}
						{{/if}}
					{{/compare1}}
					{{/if}}
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 2多选题checkbox -->
		<script type="text/x-handlebars-template" id="checkBoxTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						{{#if hv}}
						{{#compare1 hv '3'}}
								<table class='tableQuColItem'>
									{{#each questionCheckBox}}
										<tr>
											{{#cellCount002 cellCount}}{{/cellCount002}}
										</tr>
									{{/each}}
								</table>
							{{else}}
								{{#if hv}}
								{{#compare1 hv '1'}}
										<ul class="transverse">
											{{#each questionCheckBox}}
												<li class="quCoItemUlLi">
													<div class="dwQuOptionItemContent">
														<label class="dwCheckboxStyle dwQuInputLabel" ></label>
														<input type="checkbox" name="tag_qu_{{quType}}_{{quId}}_{{id}}" value="{{id}}" >
														<label class="quCoOptionEdit quCoOptionPadding">{{optionName}}</label>
														<input type='text' class='inputSytle_1' style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}" name="text_tag_qu_{{quType}}_{{quId}}_{{id}}" />
													</div>
												</li>
											{{/each}}
										</ul>
									{{else}}
										<ul>
											{{#each questionCheckBox}}
												<li class="quCoItemUlLi">
													<div class="dwQuOptionItemContent">
														<label class="dwCheckboxStyle dwQuInputLabel" ></label>
														<input type="checkbox" name="tag_qu_{{quType}}_{{quId}}_{{id}}" value="{{id}}" >
														<label class="quCoOptionEdit quCoOptionPadding">{{optionName}}</label>
														<input type='text' class='inputSytle_1' style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}" name="text_tag_qu_{{quType}}_{{quId}}_{{id}}" />
													</div>
												</li>
											{{/each}}
										</ul>
								{{/compare1}}
								{{/if}}
						{{/compare1}}
						{{/if}}
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 3填空题fillblank -->
		<script type="text/x-handlebars-template" id="fillblankTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem"><ul>
						<li class="quCoItemUlLi">
							<div class="quFillblankItem">
								{{#if answerInputRow}}
									{{#compare1 checkType '8'}}
											<input type="text" name="qu_{{quType}}_{{id}}" style="width: 300px;padding: 6px 10px 5px;border: 1px solid #83ABCB;outline: none;" class="fillblankInput Wdate"/>
										{{else}}
											{{#compare1 answerInputRow '1'}}
													<input type="text" name="qu_{{quType}}_{{id}}" style="width:{{answerInputWidth}}px;" class="inputSytle_1 fillblankInput" >
												{{else}}
													<textarea name="qu_{{quType}}_{{id}}" rows="{{answerInputRow}}" style="width:{{answerInputWidth}}px;"class="inputSytle_2 fillblankInput" ></textarea>
											{{/compare1}}
									{{/compare1}}
								{{/if}}
								<div class="dwComEditMenuBtn" ></div>
							</div>
						</li>
					</ul>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 9排序题orderby -->
		<script type="text/x-handlebars-template" id="orderbyTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem quOrderByCoItem">
						<div class="quOrderByRight">
							<table class="quOrderByTable" style="padding:5px;">
								{{#each questionOrderBy}}
									<tr class="quOrderByTableTr">
										<td class="quOrderyTableTd">{{showIndex @index}}</td>
										<td class="quOrderTabConnect"></td>
									</tr>
								{{/each}}
							</table>
						</div>
						<div  class="quOrderByLeft">
							<ul class="quOrderByLeftUl">
								{{#each questionOrderBy}}
									<li class="quCoItemUlLi">
										<label class="quCoOptionEdit">{{optionName}}
											<input name="item_qu_{{quType}}_{{quId}}_{{id}}" value="1" type="hidden" class="quOrderItemHidInput">
										</label>
									</li>
								{{/each}}
							</ul>
						</div>
						<div style="clear: both;"></div>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 16分页pagetag -->
		<script type="text/x-handlebars-template" id="pagetagTemplate">
			<div class="surveyQuItem">
				<div class="pageBorderTop nohover"></div>
				<div class="surveyQuItemContent" style="padding-top: 12px;height: 30px;min-height: 30px;">
					<a href="#" class="sbtn24 sbtn24_0 nextPage_a" >下一页</a>&nbsp;&nbsp;
					{{#if pageNo}}
					{{#compare7 pageNo}}
						<a href="#" class="sbtn24 sbtn24_1 prevPage_a">上一页</a>
						{{else}}
					{{/compare7}}
					{{/if}}
					<input type="hidden" name="nextPageNo" value="{{pageNo}}">
				</div>
			</div>
		</script>
		
		<!-- 17段落paragraph -->
		<script type="text/x-handlebars-template" id="paragraphTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent" style="min-height: 35px;">
					<div class="quCoTitle" style="background: rgb(243, 247, 247);">
						<div class="quCoTitleEdit" style="padding-left: 15px;">{{quTitle}}</div>
					</div>
				</div>
			</div>
		</script>
		
		<!-- 4多项填空题multi-fillblank -->
		<script type="text/x-handlebars-template" id="multiFillblankTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						<table class="mFillblankTable" cellpadding="0" cellspacing="0">
							{{#each questionMultiFillBlank}}
								<tr class="mFillblankTableTr">
									<td align="right" class="mFillblankTableEditTd"><label class="quCoOptionEdit">{{optionName}}</label>
										<input class="dwMFillblankOptionId" type="hidden" value="{{id}}" disabled="disabled">
										<input type="hidden" name="answerTag" value="0">
									</td>
									<td><input name="text_qu_{{quType}}_{{quId}}_{{id}}" type="text" style="width:200px;padding:5px;" class="inputSytle_1 dwMFillblankInput"></td>
								</tr>
							{{/each}}
						</table>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 11矩阵单选题chen-radio -->
		<script type="text/x-handlebars-template" id="chenRadioTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit">{{quTitle}}<span class="fraction">（{{fraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						<div class="quCoItemLeftChenTableDiv">
							<table class="quCoChenTable" >
								<tr><td></td>
									{{#each questionChenColumn}}
										<td class="quChenColumnTd">
											<label class="quCoOptionEdit">{{optionName}}</label>
										</td>
									{{/each}}
								</tr>
								{{#each questionChenRow}}
									<tr class="dwQuCoChenRowTr">
										<td class="quChenRowTd"><label class="quCoOptionEdit">{{optionName}}</label>
											<input type="hidden" class="answerTag" value="0" >
										</td>
										{{#each questionChenColumn}}
											<td>
												<div class="dwQuOptionItemContent">
													<label class="dwRedioStyle dwQuInputLabel" ></label>
													<input type="hidden" class="dwChenInputTemp" disabled="disabled" value="{{../id}}:{{id}}">
													<input name="item_qu_{{quType}}_{{quId}}_{{../id}}" value="{{id}}" type="radio"> 
												</div>
											</td>
										{{/each}}
									</tr>
								{{/each}}
							</table>
						</div>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 13矩阵多选题chen-checkbox -->
		<script type="text/x-handlebars-template" id="chenCheckboxTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						<div class="quCoItemLeftChenTableDiv">
							<table class="quCoChenTable" >
								<tr><td></td>
									{{#each questionChenColumn}}
										<td class="quChenColumnTd">
											<label class="quCoOptionEdit">{{optionName}}</label>
										</td>
									{{/each}}
								</tr>
								{{#each questionChenRow}}
									<tr class="dwQuCoChenRowTr">
										<td class="quChenRowTd"><label class="quCoOptionEdit">{{optionName}}</label>
											<input type="hidden" name="item_qu_{{quType}}_{{quId}}_{{id}}" value="ck_item_qu_{{quType}}_{{quId}}_{{id}}_" />
											<input type="hidden" class="answerTag" value="0" >
										</td>
										{{#each questionChenColumn}}
											<td>
												<div class="dwQuOptionItemContent">
													<label class="dwCheckboxStyle dwQuInputLabel" ></label>
													<input type="hidden" class="dwChenInputTemp" disabled="disabled" value="{{../id}}:{{id}}">
													<input name="ck_item_qu_{{quType}}_{{quId}}_{{../id}}_{{id}}" value="{{id}}" type="checkbox"> 
												</div>
											</td>
										{{/each}}
									</tr>
								{{/each}}
							</table>
						</div>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 12矩阵填空题chen-fbk -->
		<script type="text/x-handlebars-template" id="chenFbkTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						<div class="quCoItemLeftChenTableDiv">
							<table class="quCoChenTable" >
								<tr><td></td>
									{{#each questionChenColumn}}
										<td class="quChenColumnTd"><label class="quCoOptionEdit">{{optionName}}</label>
										</td>
									{{/each}}
								</tr>
								{{#each questionChenRow}}
									<tr class="dwQuCoChenRowTr">
										<td class="quChenRowTd"><label class="quCoOptionEdit">{{optionName}}</label>
											<input type="hidden" name="item_qu_{{quType}}_{{quId}}_{{id}}" value="fbk_item_qu_{{quType}}_{{quId}}_{{id}}_" />
										</td>
										{{#each questionChenColumn}}
											<td>
												<div class="dwQuChenFbkOptionItemContent">
													<input type="hidden" class="dwChenInputTemp" disabled="disabled" value="{{../id}}:{{id}}">
													<input name="fbk_item_qu_{{quType}}_{{quId}}_{{../id}}_{{id}}" class="inputSytle_1 dwChenMFillblankInput" type="text"> 
													<input type="hidden" class="answerTag" value="0" >
												</div>
											</td>
										{{/each}}
									</tr>
								{{/each}}
							</table>
						</div>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 18矩阵评分题chen-score -->
		<script type="text/x-handlebars-template" id="chenScoreTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						<div class="quCoItemLeftChenTableDiv">
							<table class="quCoChenTable" >
								<tr><td></td>
									{{#each questionChenColumn}}
										<td class="quChenColumnTd"><label class="quCoOptionEdit">{{optionName}}</label>
										</td>
									{{/each}}
								</tr>
								{{#each questionChenRow}}
									<tr class="dwQuCoChenRowTr">
										<td class="quChenRowTd"><label class="quCoOptionEdit">{{optionName}}</label>
											<input type="hidden" name="item_qu_{{quType}}_{{quId}}_{{id}}" value="cs_item_qu_{{quType}}_{{quId}}_{{id}}_" />
										</td>
										{{#each questionChenColumn}}
											<td>
												<div class="dwQuScoreOptionItemContent">
													<input type="hidden" class="dwChenInputTemp" disabled="disabled" value="{{../id}}:{{id}}">
													<select name="cs_item_qu_{{quType}}_{{quId}}_{{../id}}_{{id}}" class="quChenScoreSelect" > 
														<option value="0">-评分-</option>
														{{#scoreNum001 5}}{{/scoreNum001}}
													</select> 
													<input type="hidden" class="answerTag" value="0" >
												</div>
											</td>
										{{/each}}
									</tr>
								{{/each}}
							</table>
						</div>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<!-- 8评分题score -->
		<script type="text/x-handlebars-template" id="scoreTemplate">
			<div class="surveyQuItem">
				<div class="surveyQuItemContent">
					<div class="quCoTitle">
						<div class="quCoNum">{{showQuestionIndex quType}}、</div>
						<div class="quCoTitleEdit" >{{quTitle}}<span class="fraction">（{{fraction}}分）</span></div>
					</div>
					<div class="showOtherFile">
						
					</div>
					<div class="quCoItem">
						<table class="quCoItemTable" cellpadding="0" cellspacing="0">
							{{#each quScores}}
								<tr class="quScoreOptionTr">
									<td class="quCoItemTableTd quOptionEditTd">
										<label class="quCoOptionEdit">{{optionName}}</label>
										<input class="dwScoreOptionId" value="{{id}}" disabled="disabled" type="hidden"/>
										<input type="hidden" class="answerTag" value="0" >
									</td>
									<td class="quCoItemTableTd">
										<table class="scoreNumTable" border="0" cellspacing="0" cellpadding="1" style="border-collapse: initial;">
											<tr>
												{{#showParamInt02 paramInt02}}{{/showParamInt02}}
											</tr>
										</table>
										<input name="item_qu_{{quType}}_{{quId}}_{{id}}" value="" type="hidden" class="scoreNumInput" >
									</td>
									<td class="quCoItemTableTd scoreNumText">分</td>
								</tr>
							{{/each}}
						</table>
					</div>
					<fieldset class="layui-elem-field site-demo-button">
						<legend>上传图片答案</legend>
  						<div>
    						<div class="upload questionPicture" id="questionPicture{{id}}"></div>
  						</div>
					</fieldset>
				</div>
			</div>
		</script>
		
		<script src="../../assets/lib/layui/layui.js"></script>
		<script src="../../assets/lib/layui/custom.js"></script>
		<script type="text/javascript">
			var quIndex = 0;//问题序号
			var pageNum = 1;//模拟页码
			var nowPageNum = 1;//当前页码
			
			var bgAnDate = "";//答卷开始时间
			layui.config({
				base: basePath,
				version: skyeyeVersion
			}).extend({
			    window: 'js/winui.window',
			}).define(['window', 'jquery', 'winui', 'validate', 'weixinAudio', 'fileUpload'], function(exports) {
				winui.renderColor();
				layui.use(['form', 'jqueryUI'], function(form) {
					var $ = layui.$,
						form = layui.form;
					//手机端加载该页面时加载userToken
					var userToken = GetUrlParam("userToken");
					if (!isNull(userToken)){
						setCookie(userTokenKey, userToken);
					}
					bgAnDate = getFormatDate();

                    // 获取其他页面跳转过来的参数
                    // var a = GetUrlParam('surveyId');
                    // console.log(111,a);
					AjaxPostUtil.request({url:schoolBasePath + "takeExam", params: {id: getUrlParam("surveyId")}, type: 'json', callback: function (json) {
						showGrid({
							id: "wrap",
							url: schoolBasePath + "exam024",
							params: {rowId: getUrlParam("rowId")},
							pagination: false,
							template: getFileContent('tpl/examing/examTemplate.tpl'),
							ajaxSendLoadBefore: function(hdb, json) {
								hdb.registerHelper("showQuestionIndex", function(v1, options) {
									if(v1 == '16' || v1 == '17'){
									} else {
										quIndex++;
										return quIndex;
									}
								});

								hdb.registerHelper("showIndex", function(v1, options) {
									return parseInt(v1) + 1;
								});

								hdb.registerHelper("showParamInt02", function(v1, options) {
									var str = "";
									for(var i = 1; i <= v1; i++) {
										str += "<td style='background-color: white;'>" + i + "</td>";
									}
									return str;
								});

								hdb.registerHelper('compare1', function(v1, v2, options) {
									if(v1 == v2) {
										return options.fn(this);
									} else {
										return options.inverse(this);
									}
								});

								hdb.registerHelper('showQuestion', function(v1, i, options) {
									switch (v1) {
										case 1://1单选题radio
											return new Handlebars.SafeString(getDataUseHandlebars($("#radioTemplate").html(), json.rows[i]));
											break;
										case 2://2多选题checkbox
											return new Handlebars.SafeString(getDataUseHandlebars($("#checkBoxTemplate").html(), json.rows[i]));
											break;
										case 3://3填空题fillblank
											return new Handlebars.SafeString(getDataUseHandlebars($("#fillblankTemplate").html(), json.rows[i]));
											break;
										case 4://4多项填空题multi-fillblank
											return new Handlebars.SafeString(getDataUseHandlebars($("#multiFillblankTemplate").html(), json.rows[i]));
											break;
										case 8://8评分题score
											return new Handlebars.SafeString(getDataUseHandlebars($("#scoreTemplate").html(), json.rows[i]));
											break;
										case 9://9排序题orderby
											return new Handlebars.SafeString(getDataUseHandlebars($("#orderbyTemplate").html(), json.rows[i]));
											break;
										case 11://11矩阵单选题chen-radio
											return new Handlebars.SafeString(getDataUseHandlebars($("#chenRadioTemplate").html(), json.rows[i]));
											break;
										case 12://12矩阵填空题chen-fbk
											return new Handlebars.SafeString(getDataUseHandlebars($("#chenFbkTemplate").html(), json.rows[i]));
											break;
										case 13://13矩阵多选题chen-checkbox
											return new Handlebars.SafeString(getDataUseHandlebars($("#chenCheckboxTemplate").html(), json.rows[i]));
											break;
										case 16://16分页pagetag
											return new Handlebars.SafeString(getDataUseHandlebars($("#pagetagTemplate").html(), json.rows[i]));
											break;
										case 17://17段落paragraph
											return new Handlebars.SafeString(getDataUseHandlebars($("#paragraphTemplate").html(), json.rows[i]));
											break;
										case 18://18矩阵评分题chen-score
											return new Handlebars.SafeString(getDataUseHandlebars($("#chenScoreTemplate").html(), json.rows[i]));
											break;
									}
								});

								hdb.registerHelper('compare2', function(v1, v2, options) {
									if(v1 == v2) {
										return 'display: none;';
									} else {
										return '';
									}
								});

								hdb.registerHelper('compare3', function(v1, v2, options) {
									if(v1 > v2) {
										return options.fn(this);
									} else {
										return options.inverse(this);
									}
								});

								hdb.registerHelper('compare4', function(v1, options) {
									if(v1 == nowPageNum) {
										return '';
									} else {
										return 'display: none;';
									}
								});

								hdb.registerHelper('compare5', function(v1, options) {
									if(v1 == '16'){
										if(pageNum == '1'){
											pageNum++;
											return '';
										} else {
											pageNum++;
										}
									}
									if(pageNum == '1'){
										return '';
									} else {
										return 'display: none;';
									}
								});

								hdb.registerHelper('compare6', function(v1, options) {
									return pageNum;
								});

								hdb.registerHelper('compare7', function(v1, options) {
									if(nowPageNum == '1'){
										return options.inverse(this);
									} else {
										return options.fn(this);
									}
								});

								hdb.registerHelper('compare8', function(v1, v2) {
									if(v1 == 3){
										//填空题
										return '<input type="hidden" class="checkType" value="' + v2 + '">';
									}
									return "";
								});

								hdb.registerHelper('compare9', function(v1, v2, v3) {
									if(v1 == 8){
										//评分题
										return '<input type="hidden" class="geLe" value="' + v2 + '">'
												+ '<input type="hidden" class="scoreNum" value="' + v3 + '">';
									}
									return "";
								});

								hdb.registerHelper('compare10', function(v1, v2) {
									if(v1 == 2){
										//多选题
										return '<input type="hidden" name="qu_' + v1 + '_' + v2 + '" value="tag_qu_' + v1 + '_' + v2 + '_" />';
									} else if (v1 == 9 || v1 == 11 || v1 == 13 || v1 == 12 || v1 == 18 || v1 == 8){
										//排序题，矩阵单选题，矩阵多选题，矩阵填空题，矩阵评分题，评分题
										return '<input type="hidden" name="qu_' + v1 + '_' + v2 + '" value="item_qu_' + v1 + '_' + v2 + '_" />';
									} else if (v1 == 4){
										//多项填空题
										return '<input type="hidden" name="qu_' + v1 + '_' + v2 + '" value="text_qu_' + v1 + '_' + v2 + '_" />';
									}
									return "";
								});

								hdb.registerHelper("cellCount001", function(v1, options) {
									var str = "";
									var width = 600 / v1;
									for(var i = 1; i <= v1; i++) {
										str += '<td width="' + width + 'px">' +
											'<div class="dwQuOptionItemContent">' +
											'<label class="dwRedioStyle dwQuInputLabel" ></label>' +
											'<input type="radio" name="qu_{{quType}}_{{quId}}" value="{{id}}" >' +
											'<label style="width:' + (width - 10) + 'px;" class="editAble quCoOptionEdit quCoOptionPadding">{{optionName}}</label>' +
											'<input type="text" class="inputSytle_1" style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}" name="text_qu_{{quType}}_{{quId}}_{{id}}" />' +
											'</div>' +
											'</td>';
									}
									str += '<div class="emptyTd"></div>';
									return str;
								});

								hdb.registerHelper("cellCount002", function(v1, options) {
									var str = "";
									var width = 600 / v1;
									for(var i = 1; i <= v1; i++) {
										str += '<td width="' + width + 'px">' +
											'<div class="dwQuOptionItemContent">' +
											'<label class="dwCheckboxStyle dwQuInputLabel" ></label>' +
											'<input type="checkbox" name="tag_qu_{{quType}}_{{quId}}" value="{{id}}" >' +
											'<label style="width:' + (width - 10) + 'px;" class="editAble quCoOptionEdit quCoOptionPadding">{{optionName}}</label>' +
											'<input type="text" class="inputSytle_1" style="width:200px;padding:5px;{{#compare2 isNote 0}}{{/compare2}}" name="text_tag_qu_{{quType}}_{{quId}}_{{id}}" />' +
											'</div>' +
											'</td>';
									}
									str += '<div class="emptyTd"></div>';
									return str;
								});

								hdb.registerHelper("scoreNum001", function(v1, options) {
									var str = "";
									for(var i = 1; i <= v1; i++) {
										str += '<option value="' + i + '">' + i + '分</option>';
									}
									return str;
								});
							},
							ajaxSendAfter: function(json) {
								loadModel();

								loadOther(json);
							}
						});
		 	   		}});
					
					/**
	 	      		 * 加载视频，音频，图片等
	 	      		 */
	 	      		function loadOther(json){
	 	      			$.each(json.rows, function(m, bean){
		 	   				// 1.加载视频，音频，图片
		 	   				var qBodyItem = $("input[name='quId'][value='" + bean.id + "']").parents(".surveyQuItemBody");
		 	   				loadShowOtherFile(qBodyItem, bean);
		 	   				// 2.加载答案附件上传插件
		 	   				if(bean.whetherUpload == 1){
			 	   				loadUploadPic(bean.id);
		 	   				} else {
		 	   					qBodyItem.find("fieldset").remove();
		 	   				}
	 	      			});
	 	      			form.render();
	 	      		}
					
					// 加载答案附件上传插件
					function loadUploadPic(quId){
						// 初始化图片上传
				 		$("#questionPicture" + quId).upload({
				            "action": reqBasePath + "common003",
				            "data-num": "5",
				            "data-type": imageType,
				            "uploadType": 16,
				            "function": function (_this, data) {
				                show(_this, data);
				            }
				        });
					}
	 	   			
	 	   			// 加载视频，音频，图片等
	 	   			function loadShowOtherFile(qBodyItem, bean){
	 	   				var fileType = bean.fileType;
	 	   				var fileUrl = bean.fileUrl;
	 	   				var str = "";
	 	   				if(fileType == 1){
	 	   					// 视频
	 	   					str = '<div><img src="../../assets/images/icon/icon-vedio.png" class="questionShowVedio" fileUrl="' + fileUrl + '"/></div>';
	 	   				} else if (fileType == 2){
	 	   					// 音频
	 	   					str = '<div><img src="../../assets/images/icon/icon-audio.png" class="questionShowAudio" fileUrl="' + fileUrl + '" quTitle="' + bean.quTitle + '"/></div>';
	 	   				} else if (fileType == 3){
	 	   					// 图片
	 	   					str = '<img src="' + fileUrl + '" class="questionShowImg" />';
	 	   				}
	 	   				qBodyItem.find(".showOtherFile").html(str);
	 	   			}
	 	   			
	 	   			// 试题相关视频点击
	 	   			$("body").on("click", ".questionShowVedio", function (e) {
	 	   				var url = $(this).attr("fileUrl");
	 	   				var loadstr = '<video width="100%" height="99%" controls="controls" autobuffer="autobuffer" autoplay="autoplay" loop="loop">' 
	 	   								+ '<source src="' + url + '" type="video/mp4"></source></video>';
						layer.open({
							type: 1,
							title: '播放视频',
							area: ['70vw', '70vh'],
							content: loadstr,
							offset: 'auto'
						});
	 	   			});
	 	   			
	 	   			// 试题相关音频点击
	 	   			$("body").on("click", ".questionShowAudio", function (e) {
	 	   				var url = $(this).attr("fileUrl");
	 	   				var quTitle = $(this).attr("quTitle");
	 	   				var loadstr = '<p class="weixinAudio">'
	 	   								+ '<audio src="" id="media" width="1" height="1" preload></audio>'
	 	   								+ '<span id="audio_area" class="db audio_area">'
	 	   									+ '<span class="audio_wrp db">'
	 	   										+ '<span class="audio_play_area">'
	 	   											+ '<i class="icon_audio_default"></i>'
	 	   											+ '<i class="icon_audio_playing"></i>'
	 	   										+ '</span>'
	 	   										+ '<span id="audio_length" class="audio_length tips_global"></span>'
	 	   										+ '<span class="db audio_info_area">'
	 	   											+ '<strong class="db audio_title">' + quTitle + '</strong>'
	 	   											+ '<span class="audio_source tips_global">试题音频文件</span>'
	 	   										+ '</span>'
	 	   										+ '<span id="audio_progress" class="progress_bar" style="width: 0%;"></span>'
	 	   									+ '</span>'
						 	   			+ '</span>'
					 	   			+ '</p>';
		 	   			layer.open({
							type: 1,
							title: '播放音频',
							area: ['70vw', '110px'],
							content: loadstr,
							offset: 'auto',
							success: function (index) {
								$('.weixinAudio').weixinAudio({
									autoplay: false,
									src: url
								});
							}
						});
	 	   			});
	 	   			
	 	   			// 试题相关图片点击
	 	   			$("body").on("click", ".questionShowImg", function (e) {
	 	   				var url = $(this).attr("src");
	 	   				showPicDisk([url]);
	 	   			});

					//获取url中的参数
					function getUrlParam(name) {
						var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
						var r = window.location.search.substr(1).match(reg); //匹配目标参数
						if(r != null) return unescape(r[2]);
						return null; //返回参数值
					}

					//分页设置 nextPage_a prevPage_a
					$("body").on("click", ".nextPage_a", function(e) {
						var thParent = $(this).parent();
						nowPageNum = nowPageNum + 1;
						$(".li_surveyQuItemBody").hide();
						$(".surveyQu_" + nowPageNum).fadeIn("slow");
						$("html,body").animate({
							scrollTop: 10
						}, 500);
						return false;
					});
					$("body").on("click", ".prevPage_a", function(e) {
						var thParent = $(this).parent();
						nowPageNum = nowPageNum - 1;
						$(".li_surveyQuItemBody").hide();
						$(".surveyQu_" + nowPageNum).fadeIn("slow");
						$(window).scrollTop(10);
						return false;
					});
					
					$.fn.serializeJson = function() {
				        var serializeObj = {};
				        var array = this.serializeArray();
				        var str = this.serialize();
				        $(array).each(function() {
		                    if (serializeObj[this.name]) {
		                        if ($.isArray(serializeObj[this.name])) {
		                            serializeObj[this.name].push(this.value);
		                        } else {
		                            serializeObj[this.name] = [
		                                    serializeObj[this.name], this.value ];
		                        }
		                    } else {
		                        serializeObj[this.name] = this.value;
		                    }
		                });
				        return serializeObj;
				    };
						
				    function loadModel(){
						var prevHost = $("#prevHost").val();
						//初始化弹出窗口参数
						var surveyStyleId = $("#surveyStyleId").val();
						if(surveyStyleId != "") {
							/** 背景样式 **/
							var showBodyBi = "${surveyStyle.showBodyBi}";
							var bodyBgColor = "${surveyStyle.bodyBgColor}";
							var bodyBgColorObj = $("input[name='bodyBgColor']");
							bodyBgColorObj.val(bodyBgColor);
							var bodyBCThemeParamObj = bodyBgColorObj.parents(".theme_param");
							bodyBCThemeParamObj.find(".color_box").css({
								"background-color": bodyBgColor
							});
							$("body").css({
								"background-color": bodyBgColor
							});
	
							var bodyBgImage = "${surveyStyle.bodyBgImage}";
							var bodyBgImageObj = $("input[name='bodyBgImage']");
							var bodyBIThemeParamObj = bodyBgImageObj.parents(".theme_param");
							bodyBgImageObj.val(bodyBgImage);
							bodyBIThemeParamObj.find(".previewImage").attr("src", prevHost + bodyBgImage);
							if(showBodyBi == 1) {
								$("body").css({
									"background-image": "url(" + prevHost + bodyBgImage + ")"
								});
								$("input[name='showBodyBi']").prop("checked", true);
							}
	
							/** 表头样式 **/
							var showSurveyHbgi = "${surveyStyle.showSurveyHbgi}";
							var surveyHeadBgColor = "${surveyStyle.surveyHeadBgColor}";
							var surveyHeadBgColorObj = $("input[name='surveyHeadBgColor']");
							var surveyHBCThemeParamObj = surveyHeadBgColorObj.parents(".theme_param");
							surveyHeadBgColorObj.val(surveyHeadBgColor);
							surveyHBCThemeParamObj.find(".color_box").css({
								"background-color": surveyHeadBgColor
							});
							$("#dwSurveyHeader").css({
								"background-color": surveyHeadBgColor
							});
	
							var surveyHeadBgImage = "${surveyStyle.surveyHeadBgImage}";
							var surveyHeadBgImageObj = $("input[name='surveyHeadBgImage']");
							var surveyHBIThemeParamObj = surveyHeadBgImageObj.parents(".theme_param");
							surveyHeadBgImageObj.val(surveyHeadBgImage);
							surveyHBIThemeParamObj.find(".previewImage").attr("src", prevHost + surveyHeadBgImage);
							if(showSurveyHbgi == 1) {
								$("#dwSurveyHeader").css({
									"background-image": "url(" + prevHost + surveyHeadBgImage + ")"
								});
								$("input[name='showSurveyHbgi']").prop("checked", true);
							}
	
							var surveyHeadPaddingTop = "${surveyStyle.surveyHeadPaddingTop}";
							var surveyHeadPaddingBottom = "${surveyStyle.surveyHeadPaddingBottom}";
							$("#dwSurveyHeader").css({
								"padding-top": surveyHeadPaddingTop + "px"
							});
							$("#dwSurveyHeader").css({
								"padding-bottom": surveyHeadPaddingBottom + "px"
							});
	
							/** 内容中间样式 **/
							var showSurveyCbim = "${surveyStyle.showSurveyCbim}";
							var surveyContentBgColorMiddle = "${surveyStyle.surveyContentBgColorMiddle}";
							var surveyContentBgColorMiddleObj = $("input[name='surveyContentBgColorMiddle']");
							var surveyCBCMThemeParamObj = surveyContentBgColorMiddleObj.parents(".theme_param");
							surveyContentBgColorMiddleObj.val(surveyContentBgColorMiddle);
							surveyCBCMThemeParamObj.find(".color_box").css({
								"background-color": surveyContentBgColorMiddle
							});;
							$("#dwSurveyQuContentBg").css({
								"background-color": surveyContentBgColorMiddle
							});
	
							var surveyContentBgImageMiddle = "${surveyStyle.surveyContentBgImageMiddle}";
							var surveyContentBgImageMiddleObj = $("input[name='surveyContentBgImageMiddle']");
							var surveyCBIMThemeParamObj = surveyContentBgImageMiddleObj.parents(".theme_param");
							surveyContentBgImageMiddleObj.val(surveyContentBgImageMiddle);
							surveyCBIMThemeParamObj.find(".previewImage").attr("src", prevHost + surveyContentBgImageMiddle);
							if(showSurveyCbim == 1) {
								$("#dwSurveyQuContentBg").css({
									"background-image": "url(" + prevHost + surveyContentBgImageMiddle + ")"
								});
								$("input[name='showSurveyCbim']").prop("checked", true);
							}
	
							/** 文本样式 **/
							var questionTitleTextColor = "${surveyStyle.questionTitleTextColor}";
							var questionTitleTextColorObj = $("input[name='questionTitleTextColor']");
							var questionTTCThemeParamObj = questionTitleTextColorObj.parents(".theme_param");
							questionTitleTextColorObj.val(questionTitleTextColor);
							questionTTCThemeParamObj.find(".color_box").css({
								"background-color": questionTitleTextColor
							});
							$(".quCoTitle").css({
								"color": questionTitleTextColor
							});
	
							var questionOptionTextColor = "${surveyStyle.questionOptionTextColor}";
							var questionOptionTextColorObj = $("input[name='questionOptionTextColor']");
							var questionOTCThemeParamObj = questionOptionTextColorObj.parents(".theme_param");
							questionOptionTextColorObj.val(questionOptionTextColor);
							questionOTCThemeParamObj.find(".color_box").css({
								"background-color": questionOptionTextColor
							});
							$(".quCoOptionEdit").css({
								"color": questionOptionTextColor
							});
	
							var surveyTitleTextColor = "${surveyStyle.surveyTitleTextColor}";
							var surveyTitleTextColorObj = $("input[name='surveyTitleTextColor']");
							var surveyTTCThemeParamObj = surveyTitleTextColorObj.parents(".theme_param");
							surveyTitleTextColorObj.val(surveyTitleTextColor);
							surveyTTCThemeParamObj.find(".color_box").css({
								"background-color": surveyTitleTextColor
							});
							$("#dwSurveyTitle").css({
								"color": surveyTitleTextColor
							});
	
							var surveyNoteTextColor = "${surveyStyle.surveyNoteTextColor}";
							var surveyNoteTextColorObj = $("input[name='surveyNoteTextColor']");
							var surveyNTCThemeParamObj = surveyNoteTextColorObj.parents(".theme_param");
							surveyNoteTextColorObj.val(surveyNoteTextColor);
							surveyNTCThemeParamObj.find(".color_box").css({
								"background-color": surveyNoteTextColor
							});
							$("#dwSurveyNoteEdit").css({
								"color": surveyNoteTextColor
							});
	
							var surveyBtnBgColor = "${surveyStyle.surveyBtnBgColor}";
							if(surveyBtnBgColor !== "") {
								$("#dw_body_content .sbtn24,.progressbarDiv .ui-progressbar-value").css({
									"background-color": surveyBtnBgColor
								});
								$(".progressbarDiv").css({
									"border-color": surveyBtnBgColor
								});
								$(".progress-label ").css({
									"color": surveyBtnBgColor
								});
								var surveyBtnBgColorObj = $("input[name='surveyBtnBgColor']");
								surveyBtnBgColorObj.val(surveyBtnBgColor);
								var btnBcThemeParamObj = surveyBtnBgColorObj.parents(".theme_param");
								btnBcThemeParamObj.find(".color_box").css({
									"background-color": surveyBtnBgColor
								});
							}
	
							//显示序号及进度条
							var showTiNum = "${surveyStyle.showTiNum}";
							var showProgressbar = "${surveyStyle.showProgressbar}";
							if(showTiNum == 0) {
								$(".quCoNum").hide();
							}
							if(showProgressbar == 0) {
								$("#resultProgressRoot").hide();
							}
	
							//表头文本显示
							var showSurTitle = "${surveyStyle.showSurTitle}";
							var showSurNote = "${surveyStyle.showSurNote}";
							if(showSurTitle == 0) {
								$("#dwSurveyTitle").hide();
							}
							if(showSurNote == 0) {
								$("#dwSurveyNote").hide();
							}
						}
						
						bindScoreNumTdHover();
						//排序题
						bindQuOrderBySorts();
						
						/******************************处理题目逻辑设置 **************************************/
						//初始化 处理默认逻辑跳转为显示，则先隐藏元素
						var quLogics = $("#dwSurveyQuContent .quLogicItem");
						$.each(quLogics, function() {
							var loginItem = $(this);
							var cgQuItemId = loginItem.find(".cgQuItemId").val();
							var skQuId = loginItem.find(".skQuId").val();
							var logicId = loginItem.find(".logicId").val();
							var logicType = loginItem.find(".logicType").val();
							if(logicType === "2") {
								//逻辑类型为“显示”2  则初始化为隐藏
								var hidQuItemBody = $(".quId[value='" + skQuId + "']").parents(".li_surveyQuItemBody");
								hidQuItemBody.hide();
								hidQuItemBody.addClass("hidFor" + logicId);
								hidQuItemBody.find(".answerTag").attr("disabled", true);
							}
						});
						
						//填空题
						$(".fillblankInput,.dwMFillblankInput,.dwChenMFillblankInput").blur(function() {
							var thVal = $(this).val();
							runlogic($(this));
							answerProgressbar($(this));
						});

						$(".quChenScoreSelect").change(function() {
							answerProgressbar($(this));
						});
						
						resetQuNum();
						
						$("#mobileTdId").click(function() {
							$(this).next().slideToggle();
							return false;
						});

						var bfbFloat = 0;
						$("#resultProgress").progressbar({
							value: bfbFloat,
							orientation: "vertical"
						});
				    }

					$("body").on("click", ".submitSurvey", function(e) {
						layer.confirm('确定提交试卷嘛？', { icon: 3, title: '提交试卷' }, function (index) {
							layer.close(index);
							var params = {
								jsonData: JSON.stringify($("#surveyForm").serializeJson()), 
								bgAnDate: bgAnDate
							};
							
							var qIbodyItems = $("#dwSurveyQuContent").find(".surveyQuItemBody");
							var quAnswerFile = new Array();
							$.each(qIbodyItems, function(i, item) {
								var upload = $(item).find(".questionPicture");
								if(upload.length > 0){
									quAnswerFile.push({
										quId: $(item).find("input[name='quId']").val(),
										url: upload.find("input[type='hidden'][name='upload']").attr("oldurl")
									});
								}
							});
							params = $.extend({}, params, $("#surveyForm").serializeJson());
							params.quAnswerFile = JSON.stringify(quAnswerFile);
							AjaxPostUtil.request({url:schoolBasePath + "exam029", params: params, type: 'json', callback: function (json) {
								$("#wrap").html('<span class="messageSpan">' + '答卷完成，感谢您的参与。' + '</span>');
				 	   		}});
						});
						return false;
					});

					//评分题
					$("body").on("click", ".scoreNumTable tr td", function(e) {
						var quScoreOptionTr = $(this).parents(".quScoreOptionTr");
						var tdText = $(this).text();
						quScoreOptionTr.find(".scoreNumTable tr td").css({
							"background": "white"
						});
						quScoreOptionTr.find(".scoreNumText").html($(this).text() + "&nbsp;分");

						$(this).prevAll().css({
							"background": ""
						});
						$(this).css({
							"background": ""
						});
						quScoreOptionTr.find(".scoreNumInput").val(tdText);
						quScoreOptionTr.find(".scoreNumText").html(tdText + "&nbsp;分");
						runlogic($(this));
						answerProgressbar($(this));
					});

					function bindScoreNumTdHover() {
						$(".scoreNumTable tr td").hover(function() {
							var quScoreOptionTr = $(this).parents(".quScoreOptionTr");
							var scoreNumInput = quScoreOptionTr.find(".scoreNumInput").val();
							if(scoreNumInput == "") {
								$(this).prevAll().css({
									"background": ""
								});
								$(this).css({
									"background": ""
								});
								quScoreOptionTr.find(".scoreNumText").html($(this).text() + "&nbsp;分");
							}
						}, function() {
							var quScoreOptionTr = $(this).parents(".quScoreOptionTr");
							var scoreNumInput = quScoreOptionTr.find(".scoreNumInput").val();
							if(scoreNumInput == "") {
								$(this).prevAll().css({
									"background": "white"
								});
								$(this).css({
									"background": "white"
								});
								quScoreOptionTr.find(".scoreNumText").html("分");
							}
						});
					}

					function bindQuOrderBySorts() {
						var quOrderByCoItems = $(".quOrderByCoItem");
						$.each(quOrderByCoItems, function() {
							$(this).find(".quOrderByLeftUl li").sortable({
								zIndex: 1000,
								scroll: false,
								opacity: 0.8,
								placeholderType: false,
								connectWith: $(this).find(".quOrderByTable td"),
								helper: function(event, ui) {
									return "<label class='quOrderItemLabel'>" + $(this).text() + "</label>";
								},
								over: function(event, ui) {

								},
								start: function(event, ui) {

								},
								drag: function(event, ui) {

								},
								stop: function(event, ui) {
									$(".quOrderByTable td").css({
										"background": ""
									});
									answerProgressbar($(this));
								}
							});
							var sortObjTempHtml = null;
							$(this).find(".quOrderByTable td").sortable({
								zIndex: 1000,
								scroll: false,
								opacity: 0.9,
								placeholderType: true,
								placeholder: "qu-order-highlight",
								connectWith: $(this).find(".quOrderByTable td"),
								over: function(event, ui) {
									$(".quOrderByTable td").css({
										"background": ""
									});
									$(this).css({
										"background": "#FAEDC0"
									});
									var quOrderItemLabel = $(this).find("label.quOrderItemLabel");
									sortObjTempHtml = "";
									if(quOrderItemLabel[0]) {
										sortObjTempHtml = quOrderItemLabel.html();
									}
								},
								receive: function(event, ui) { //当一个已连接的sortable对象接收到另一个sortable对象的元素后触发此事件。
									//判断如果是从右边新移入的，但当前td中已经有了，就交换到右边去
									var uiSenderClass = ui.sender.attr("class");
									ui.sender.empty();
									if(uiSenderClass.indexOf("quCoItemUlLi") < 0) {
										if(sortObjTempHtml != "") {
											ui.sender.append("<label class='quOrderItemLabel'>" + sortObjTempHtml + "</label>");
										}
									} else {
										if(sortObjTempHtml != "") {
											ui.sender.append("<label class='editAble quCoOptionEdit'>" + sortObjTempHtml + "</label>");
										}
									}

									$(this).empty();
									ui.item.clone().appendTo($(this));
									var quCoOptionEdit = $(this).find(".quCoOptionEdit");
									if(quCoOptionEdit[0]) {
										quCoOptionEdit.removeClass();
										quCoOptionEdit.addClass("quOrderItemLabel");
									}
									$(".quOrderByTable td").css({
										"background": ""
									});
									//更新排序ID  quCoItem quOrderByTableTr
									var quOrderyByTrs = $(".quCoItem .quOrderByTableTr");
									$.each(quOrderyByTrs, function(i) {
										var quOrderItemHidInput = $(this).find(".quOrderItemHidInput");
										quOrderItemHidInput.val(i + 1);
									});
								},
								start: function(event, ui) {
									$(".quOrderByTable td").css({
										"background": ""
									});
									$(this).css({
										"background": "#FAEDC0"
									});
								},
								drag: function(event, ui) {
									$(".quOrderByTable td").css({
										"background": ""
									});
									$(this).css({
										"background": "#FAEDC0"
									});
								},
								stop: function(event, ui) {
									$(".quOrderByTable td").css({
										"background": ""
									});
								},
								out: function(event, ui) {},
								activate: function(event, ui) {}
							});
						});
					}

					/** 单选与多选条件触发 自定义单选多选效果 操作结束后得调用逻辑判断 **/
					$("body").on("click", ".dwQuOptionItemContent", function(e) {
						var thObj = $(this);
						var quItemBody = thObj.parents(".li_surveyQuItemBody");
						var quType = quItemBody.find(".quType").val();
						var dwQuInputLabel = thObj.find(".dwQuInputLabel");
						if("RADIO" === quType) {
							//单选题
							quItemBody.find(".dwQuInputLabel").removeClass("checked");
							quItemBody.find("input[type='radio']").prop("checked", false);
							dwQuInputLabel.addClass("checked");
							thObj.find("input[type='radio']").prop("checked", true);
							runlogic(thObj.find("input[type='radio']"));
						} else if("CHECKBOX" === quType) {
							//多选题
							var quInputLabelClass = dwQuInputLabel.attr("class");
							if(quInputLabelClass.indexOf("checked") > 0) {
								dwQuInputLabel.removeClass("checked");
								thObj.find("input[type='checkbox']").prop("checked", false);
							} else {
								dwQuInputLabel.addClass("checked");
								thObj.find("input[type='checkbox']").prop("checked", true);
							}
							runlogic(thObj.find("input[type='checkbox']"));
						} else if("CHENRADIO" === quType) {
							//矩陈单选
							var chenRow = thObj.parents("tr");
							chenRow.find(".dwQuInputLabel").removeClass("checked");
							chenRow.find("input[type='radio']").prop("checked", false);
							dwQuInputLabel.addClass("checked");
							thObj.find("input[type='radio']").prop("checked", true);
							runlogic(thObj.find("input[type='radio']"));
						} else if("CHENCHECKBOX" === quType) {
							//矩陈多选
							var quInputLabelClass = dwQuInputLabel.attr("class");
							if(quInputLabelClass.indexOf("checked") > 0) {
								dwQuInputLabel.removeClass("checked");
								thObj.find("input[type='checkbox']").prop("checked", false);
							} else {
								dwQuInputLabel.addClass("checked");
								thObj.find("input[type='checkbox']").prop("checked", true);
							}
							runlogic(thObj.find("input[type='checkbox']"));
						}
						answerProgressbar(thObj);
					});

					//只要触发事件
					function runlogic(thFormElementObj) {
						var quItemBody = thFormElementObj.parents(".li_surveyQuItemBody");
						var quLogicItems = quItemBody.find(".quLogicItem");
						if(quLogicItems[0]) {
							var quInputCase = quItemBody.find(".quInputCase");
							var quId = quInputCase.find(".quId").val();
							var quType = quInputCase.find(".quType").val();
							if(quType === "RADIO" || quType === "CHECKBOX" || quType === "SCORE" || quType === "MULTIFILLBLANK" || quType === "CHENRADIO" || quType === "CHENCHECKBOX" || quType === "CHENSCORE" || quType === "CHENFBK") {
								//判断是否选中
								var quLgoicItem = null;
								//遍历每个逻辑设置
								var quOptionItems = null;
								if(quType === "RADIO" || quType === "CHECKBOX") {
									quOptionItems = quItemBody.find(".dwQuOptionItemContent");
								} else if(quType === "SCORE") {
									quOptionItems = quItemBody.find(".quScoreOptionTr");
								} else if(quType === "MULTIFILLBLANK") {
									quOptionItems = quItemBody.find(".mFillblankTableTr");
								} else if(quType === "CHENRADIO" || quType === "CHENCHECKBOX") {
									quOptionItems = quItemBody.find(".dwQuOptionItemContent");
								} else if(quType === "CHENFBK") {
									quOptionItems = quItemBody.find(".dwQuChenFbkOptionItemContent");
								}
								$.each(quLogicItems, function() {
									var loginItem = $(this);
									var cgQuItemId = loginItem.find(".cgQuItemId").val();
									var skQuId = loginItem.find(".skQuId").val();
									var logicId = loginItem.find(".logicId").val();
									var logicType = loginItem.find(".logicType").val();
									var geLe = null;
									var scoreNum = null;
									if(quType === "SCORE") {
										geLe = loginItem.find(".geLe").val();
										scoreNum = loginItem.find(".scoreNum").val();
									}
									//过滤优先级
									var isbreak = false;
									$.each(quOptionItems, function() {
										var quCoItem = $(this);
										var quInput = null;
										var logicStatus = false;
										var curQuItemId = null;
										if(quType === "RADIO") {
											quInput = quCoItem.find("input[type='radio']");
											logicStatus = quInput.prop("checked");
											curQuItemId = quInput.val();
										} else if(quType === "CHECKBOX") {
											quInput = quCoItem.find("input[type='checkbox']");
											logicStatus = quInput.prop("checked");
											curQuItemId = quInput.val();
										} else if(quType === "SCORE") {
											quInput = quCoItem.find(".dwScoreOptionId");
											var curScore = quCoItem.find(".scoreNumInput").val();
											if(curScore != "") {
												logicStatus = (geLe === "le" && curScore <= scoreNum) || (geLe === "ge" && curScore >= scoreNum);
											}
											curQuItemId = quInput.val();
										} else if(quType === "MULTIFILLBLANK") {
											quInput = quCoItem.find(".dwMFillblankOptionId");
											logicStatus = quCoItem.find(".dwMFillblankInput").val() != "";
											curQuItemId = quInput.val();
										} else if(quType === "CHENRADIO") {
											quInput = quCoItem.find("input[type='radio']");
											logicStatus = quInput.prop("checked");
											curQuItemId = quCoItem.find(".dwChenInputTemp").val();
										} else if(quType === "CHENCHECKBOX") {
											quInput = quCoItem.find("input[type='checkbox']");
											logicStatus = quInput.prop("checked");
											curQuItemId = quCoItem.find(".dwChenInputTemp").val();
										} else if(quType === "CHENFBK") {
											quInput = quCoItem.find(".dwChenMFillblankInput");
											logicStatus = quInput.val() != "";
											curQuItemId = quCoItem.find(".dwChenInputTemp").val();
										}
										if(curQuItemId === cgQuItemId) {
											if(logicType === "1") {
												//跳转
												if(logicStatus) {
													//逻辑选项被选中状态，激活状态
													skQuestion(quItemBody.next(), skQuId, logicId, function() {
														//重新编题号
													});
													if(skQuId === "1" || skQuId === "2") {
														isbreak = true;
													}
												} else {
													var hidQuItemBodys = $(".hidFor" + logicId);
													$(".hidFor" + logicId).removeClass("hidFor" + logicId);
													$.each(hidQuItemBodys, function() {
														var thQuItemBodyClass = $(this).attr("class");
														if(thQuItemBodyClass.indexOf("hidFor") < 0) {
															$(this).show();
															//回答标记与逻辑设置没有关系
															$(this).find(".answerTag").attr("disabled", false);
														}
													});
												}
											} else {
												//逻辑类型为“显示” quType=2
												if(logicStatus) {
													//逻辑选项被选中状态，激活状态  显示题
													var hidQuItemBodys = $(".hidFor" + logicId);
													$(".hidFor" + logicId).removeClass("hidFor" + logicId);
													$.each(hidQuItemBodys, function() {
														var thQuItemBodyClass = $(this).attr("class");
														if(thQuItemBodyClass.indexOf("hidFor") < 0) {
															$(this).show();
															$(this).find(".answerTag").attr("disabled", false);
														}
													});
												} else {
													//隐藏题
													var hidQuItemBody = $(".quId[value='" + skQuId + "']").parents(".li_surveyQuItemBody");
													hidQuItemBody.hide();
													hidQuItemBody.addClass("hidFor" + logicId);
													hidQuItemBody.find(".answerTag").attr("disabled", true);
												}
											}
											return false;
										}
									});
									if(isbreak) {
										return false;
									}
								});
							} else if(quType === "FILLBLANK") {
								//遍历每个逻辑设置
								var quOptionItems = quItemBody.find(".dwQuOptionItemContent");
								var thVal = thFormElementObj.val();
								$.each(quLogicItems, function() {
									var loginItem = $(this);
									var cgQuItemId = loginItem.find(".cgQuItemId").val();
									var skQuId = loginItem.find(".skQuId").val();
									var logicId = loginItem.find(".logicId").val();
									var logicType = loginItem.find(".logicType").val();
									if(logicType === "1") {
										//跳转
										if(thVal != "") {
											//逻辑选项被选中状态，激活状态
											skQuestion(quItemBody.next(), skQuId, logicId, function() {
												//重新编题号
											});
											if(skQuId === "1" || skQuId === "2") {
												isbreak = true;
											}
										} else {
											//逻辑选项未被选中状态，未激活
											var hidQuItemBodys = $(".hidFor" + logicId);
											$(".hidFor" + logicId).removeClass("hidFor" + logicId);
											$.each(hidQuItemBodys, function() {
												var thQuItemBodyClass = $(this).attr("class");
												if(thQuItemBodyClass.indexOf("hidFor") < 0) {
													$(this).show();
													//回答标记与逻辑设置没有关系
													$(this).find(".answerTag").attr("disabled", false);
												}
											});
										}
									} else {
										//显示
										//逻辑类型为“显示” quType=1
										if(thVal != "") {
											//逻辑选项被选中状态，激活状态  显示题
											var hidQuItemBodys = $(".hidFor" + logicId);
											$(".hidFor" + logicId).removeClass("hidFor" + logicId);
											$.each(hidQuItemBodys, function() {
												var thQuItemBodyClass = $(this).attr("class");
												if(thQuItemBodyClass.indexOf("hidFor") < 0) {
													$(this).show();
													$(this).find(".answerTag").attr("disabled", false);
												}
											});
										} else {
											//隐藏题
											var hidQuItemBody = $(".quId[value='" + skQuId + "']").parents(".li_surveyQuItemBody");
											hidQuItemBody.hide();
											hidQuItemBody.addClass("hidFor" + logicId);
											hidQuItemBody.find(".answerTag").attr("disabled", true);
										}
									}
								});
							}
						}
					}

					function skQuestion(nextQuItemBody, skQuId, logicId, callback) {

						if(nextQuItemBody[0]) {
							var nextQuType = nextQuItemBody.find(".quType").val();
							var nextQuId = nextQuItemBody.find(".quId").val();
							var nextAnswerTag = nextQuItemBody.find(".answerTag");
							//判断跳转类型
							if(skQuId == null) {
								//对于逻辑选项未被选中的情况
							} else if(nextQuItemBody.is(":hidden")) {
								skQuestion(nextQuItemBody.next(), skQuId, logicId, function() {

								});
							} else if(nextQuType != "submitSurveyBtn" && nextQuType != "PAGETAG" && (skQuId === "1" || skQuId === "2" || nextQuId != skQuId)) {
								//对于逻辑项是被选定的情况下
								nextAnswerTag.attr("disabled", true);
								nextQuItemBody.hide();
								nextQuItemBody.addClass("hidFor" + logicId);
								skQuestion(nextQuItemBody.next(), skQuId, logicId, function() {});
							}
						} else {
							callback();
						}
					}

					function resetQuNum() {
						var quCoNums = $(".quCoNum");
						$.each(quCoNums, function(i, item) {
							$(this).html((i + 1) + "、");
						});

					}

					/**********************处理答题进度条************************/
					function answerProgressbar(thObj) {
						var quItemBody = thObj.parents(".li_surveyQuItemBody ");
						var quType = quItemBody.find(".quType").val();
						if(quType === "RADIO") {
							var checks = quItemBody.find("input[type='radio']:checked");
							if(checks[0]) {
								quItemBody.find(".answerTag").val(1);
							} else {
								quItemBody.find(".answerTag").val(0);
							}
						} else if(quType == "CHECKBOX") {
							var checks = quItemBody.find("input[type='checkbox']:checked");
							if(checks[0]) {
								quItemBody.find(".answerTag").val(1);
							} else {
								quItemBody.find(".answerTag").val(0);
							}
						} else if(quType === "FILLBLANK") {
							var thVal = thObj.val();
							if(thVal != "") {
								quItemBody.find(".answerTag").val(1);
							} else {
								quItemBody.find(".answerTag").val(0);
							}
						} else if(quType === "ORDERBY") {
							var orderByLabels = quItemBody.find(".quOrderByLeftUl label");
							if(!orderByLabels[0]) {
								quItemBody.find(".answerTag").val(1);
							} else {
								quItemBody.find(".answerTag").val(0);
							}
						} else if(quType === "SCORE") {
							var quScoreOptionTr = thObj.parents(".quScoreOptionTr");
							var scoreNumInput = quScoreOptionTr.find(".scoreNumInput");
							if(scoreNumInput.val() != "") {
								quScoreOptionTr.find(".answerTag").val(1);
							} else {
								quScoreOptionTr.find(".answerTag").val(0);
							}
						} else if(quType === "MULTIFILLBLANK") {
							var mFillblankTableTr = thObj.parents(".mFillblankTableTr");
							if(thObj.val() != "") {
								mFillblankTableTr.find(".answerTag").val(1);
							} else {
								mFillblankTableTr.find(".answerTag").val(0);
							}
						} else if(quType === "CHENRADIO") {
							var dwQuCoChenRowTr = thObj.parents(".dwQuCoChenRowTr");
							dwQuCoChenRowTr.find(".answerTag").val(1);
						} else if(quType === "CHENCHECKBOX") {
							var dwQuCoChenRowTr = thObj.parents(".dwQuCoChenRowTr");
							var checks = dwQuCoChenRowTr.find("input[type='checkbox']:checked");
							if(checks[0]) {
								dwQuCoChenRowTr.find(".answerTag").val(1);
							} else {
								dwQuCoChenRowTr.find(".answerTag").val(0);
							}
						} else if(quType === "CHENSCORE") {
							var dwQuScoreOptionItemContent = thObj.parents(".dwQuScoreOptionItemContent");
							if(thObj.val() != "0") {
								dwQuScoreOptionItemContent.find(".answerTag").val(1);
							} else {
								dwQuScoreOptionItemContent.find(".answerTag").val(0);
							}
						} else if(quType === "CHENFBK") {
							var dwQuChenFbkOptionItemContent = thObj.parents(".dwQuChenFbkOptionItemContent");
							if(thObj.val() != "") {
								dwQuChenFbkOptionItemContent.find(".answerTag").val(1);
							} else {
								dwQuChenFbkOptionItemContent.find(".answerTag").val(0);
							}
						}
						var totalQuSize = $(".answerTag:enabled").size();
						var answerTag1 = $(".answerTag[value='1']:enabled");
						var answerQuSize = 0;
						if(answerTag1[0]) {
							answerQuSize = answerTag1.size();
						}
						var newValue = parseInt(answerQuSize / totalQuSize * 100);
						$("#resultProgressRoot .progress-label").text("完成度：" + newValue + "%");
						$("#resultProgress").progressbar("option", "value", newValue);
					}
					
				});
			});
		</script>
	</body>

</html>